import Layout from '../../layout/DefaultLayout'

const layout = function (meta = {}, name = null) {
  return {
    path: '/crm' + (name !== null ? '/' + name : ''),
    name: name,
    component: Layout,
    meta: {
      ...meta
    }
  }
}

export default [
  {
    ...layout(),
    children: [{
      path: 'dashboard', // 仪表盘
      name: 'dashboard',
      component: () => import('@/views/dashboard'),
      meta: {title: '仪表盘', icon: 'dashboard'}
    }]
  },
  {
    ...layout(),
    children: [{
      path: 'leads', // 线索
      name: 'leads',
      component: () => import('@/views/crm/customer'),
      meta: {title: '线索', icon: 'customer'}
    }]
  },
  {
    ...layout(),
    children: [{
      path: 'contacts', // 联系人
      name: 'contacts',
      component: () => import('@/views/crm/customer'),
      meta: {title: '联系人', icon: 'customer'}
    }]
  },
  {
    ...layout(),
    children: [{
      path: 'customer', // 客户
      name: 'customer',
      component: () => import('@/views/crm/customer'),
      meta: {title: '客户', icon: 'customer'}
    }]
  },
  {
    ...layout(),
    children: [{
      path: 'opportunity', // 商机
      name: 'opportunity',
      component: () => import('@/views/crm/customer'),
      meta: {title: '商机', icon: 'customer'}
    }]
  }
]
